#ifndef _FORM1_H_
#define _FORM1_H_

#include <FBase.h>
#include <FUi.h>
#include <FSocial.h>
#include "../Model/TwitterMySnsGatewayManager.h"
#include "../Ui/TwitterForm.h"

class Form1: public Osp::Ui::Controls::Form,
		public Osp::Ui::IActionEventListener,
		public Osp::Social::Services::ISnsAuthenticatorListener {


public:
	Form1(void);
	virtual ~Form1(void);
	bool Initialize(void);

	// Implementation
protected:
	//TwitterForm*pTwitterForm;
	static const int ID_BUTTON_OK = 101;
	static const int ID_SOFTKEY_BACK = 102;
	Osp::Ui::Controls::Button *__pButtonOk;
	Osp::Social::Services::SnsAuthenticator* __pAuthenticator;
	MySnsGatewayManager*pSnsGatewayManager;
	//Osp::Ui::Controls::Frame*pFrame;
	//Osp::Ui::Controls::Form *pFormParent;
	static int FormId;

public:
	void SetFormId(int id){
		FormId = id;
	}

	static int GetFormId(){
		return FormId;
	}

public:
	MySnsGatewayManager*getMySnsGatewayManager();
	virtual result OnInitializing(void);
	virtual result OnTerminating(void);
	virtual void
	OnActionPerformed(const Osp::Ui::Control& source, int actionId);

	virtual void OnSnsAuthenticated(
			Osp::Social::Services::SnsAuthResult& snsAuthResult, result r,
			const Osp::Base::String& errorCode,
			const Osp::Base::String& errorMsg);
public:
	void SetLoginStatus(bool status);
	void ExcuteLogin();
	void ExcuteBack();

};

#endif	//_FORM1_H_
